home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.04 Apr 91 / HSIM Code / Harmonic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-08  |  3.2 KB  |  146 lines  |  [TEXT/KAHL]

  1. #define    FALSE        0
  2. #define    TRUE        1
  3.  
  4. #define    BASE_RES_ID            400
  5. #define    NIL                    0L
  6. #define    MOVE_TO_FRONT        -1L
  7. #define    REMOVE_ALL_EVENTS    0
  8.  
  9. #define    SLEEP                0L
  10. #define    NIL_MOUSE_REGION    0L
  11. #define    WNE_TRAP_NUM        0x60
  12. #define    UNIMPL_TRAP_NUM        0x9f
  13.  
  14. #define    BANNER_OFFSET        96
  15. #define    HORIZONTAL_OFFSET    0
  16. #define    INITIAL_ROW            24
  17. #define    LEFT_MARGIN            10
  18. #define    ROW_HEIGHT            15
  19. #define    START_ROW            0
  20.  
  21. #define    TEXT_FONT_SIZE        10        /* in pixels */
  22. #define    GRAD_FONT_SIZE        6
  23.  
  24. #define    APPLE_MENU_ID        BASE_RES_ID
  25. #define    FILE_MENU_ID        BASE_RES_ID+1
  26. #define    EDIT_MENU_ID        BASE_RES_ID+2
  27. #define    OPTION_MENU_ID        BASE_RES_ID+3
  28.  
  29. #define    TRANSFER_ITEM        1
  30. #define QUIT_ITEM            3
  31. #define ABOUT_ITEM            1
  32. #define    COPY_ITEM            4
  33. #define    PASTE_ITEM            5
  34. #define    CLEAR_ITEM            6
  35. #define    CLIPBOARD_ITEM        7
  36. #define    SIMULATE_ITEM        1
  37. #define    PLOT_ITEM            2
  38. #define    STATUS_ITEM            3
  39.  
  40. #define ABOUT_ALERT            400
  41. #define    LAUNCH_ALERT        401
  42. #define    FREE_MEM_ALERT        402
  43. #define    ENOUGH_ALERT        403
  44. #define    ERR_ALERT            404
  45. #define    HOSED_FILE_ALERT    405
  46. #define    CLIPBOARD_ALERT        406
  47. #define    EMPTY_ALERT            407
  48. #define    PROCESS_ALERT        409
  49. #define    X_ALERT                410
  50. #define    Y_ALERT                411
  51.  
  52. /* default resource IDs for editable text */
  53.  
  54. #define    DEF_FRICTION_ID        401
  55. #define    DEF_AMPLITUDE_ID    402
  56. #define    DEF_ELASTIC_ID        403
  57. #define    DEF_START_ID        404
  58. #define    DEF_FINI_ID            405
  59. #define    DEF_X_AXIS_ID        406
  60. #define    DEF_Y_AXIS_ID        407
  61. #define    DEF_MASS_ID            408
  62. #define    DEF_INC_ID            409
  63. #define    DEF_SIM_ID            410
  64.  
  65. /* DITL item numbers */
  66.  
  67. #define    FRICTION_VALUE        4
  68. #define    AMPLITUDE_VALUE        6
  69. #define    ELASTIC_VALUE        8
  70. #define    START_VALUE            10
  71. #define    FINI_VALUE            12
  72. #define    X_VALUE                14
  73. #define    Y_VALUE                16
  74. #define    MASS_VALUE            18
  75. #define    INC_VALUE            20
  76. #define    SIM_NAME_VALUE        22
  77.  
  78. #define DRAG_THRESHOLD        30
  79.  
  80. #define    OK_BUTTON            1    /* dailog list items */
  81. #define    CANCEL_BUTTON        2
  82.  
  83. #define    ON                    TRUE
  84. #define    OFF                    FALSE
  85.  
  86. #define    FLOAT_CONST            4    /* floating pt numbers take up 4 bytes */
  87.  
  88. #define    WATCH_ICON            4
  89.  
  90. #define    WINDOW_HOME_LEFT    45    /* global coords */
  91. #define    WINDOW_HOME_RIGHT    45
  92. #define    NEW_WINDOW_OFFSET    20
  93. #define    LEAVE_WHERE_IT_IS    FALSE
  94.  
  95. #define    MinusOne            0xFFFF
  96.  
  97. #define    MIN                    0
  98. #define    MAX                    32767
  99.  
  100. /* have to be changed if graph does */
  101.  
  102. #define    GRAD_X_DELTA        36            /* gradient delta on x axis */
  103. #define    GRAD_Y_DELTA        25            /* gradient delta on y axis */
  104. #define    GRAPH_X_DELTA        367        
  105. #define    GRAPH_Y_DELTA        204
  106. #define    GRAPH_X_OFFSET        40            /* offset from right of window */
  107. #define    GRAPH_Y_OFFSET        244            /* offset from top of window */
  108.  
  109.  
  110. /*************    globals    ***************/
  111.  
  112. typedef    struct
  113. {
  114.     StringPtr    pfName;            /* ptr to the name of launchee */
  115.     short int    param;
  116.     char        LC[2];            /* extended params: */
  117.     long int    extBlockLen;    /* number of bytes in extension == 6 */
  118.     short int    fFlags;            /* finder file info flags */
  119.     long int launchFlags;        /* bits 30, & 31 equal 1 for sublaunch */
  120. }  LaunchStruct, *pLaunchStruct;
  121.  
  122. /* used by dialog input routines */
  123.  
  124. typedef struct
  125. {
  126.     Str255    frict,
  127.             amp,
  128.             elastic,
  129.             start,
  130.             fini,
  131.             xVal,
  132.             yVal,
  133.             mass,
  134.             ink,
  135.             simName;
  136. }  SavedSettings, *SavedSettingsPtr;
  137.     
  138. typedef    struct
  139. {
  140.     int        length;        /* coord pair length */
  141.     float    *xPtr;        /* ptr to list of x values */
  142.     float    *yPtr;        /* ptr to list of y values */
  143. }  xyCoords, *xyCoordsPtr;
  144.  
  145.  
  146.